package com.io.example.demoparent.builder;

//指挥者
public class HouseDirector {

    HouseBuilder  houseBuilder=null;


    //构造器
      public HouseDirector(HouseBuilder houseBuilder){
          this.houseBuilder=houseBuilder;
      }

    //setter
    public void setHouseBuilder(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }


    //如何处理建造房子的流程，交给指挥者
    public House  constructHouse(){
        houseBuilder.buildBasic();
        houseBuilder.buildWalls();
        houseBuilder.roofed();
        return houseBuilder.build();
    }

}
